package com.jiantong.work.enums;

/**
 * Created by niufei on 2017/5/3.
 *
 */
public enum AuthorityType {

    ILLEGAL_MAN(-2,"此人不正常"),
    ONE_EXCLUDE(-1,"检疫不能做"),
    NON(0,"全权"),
    CD_JY(1,"产地检疫"),
    RC_JC(2,"入场检查"),
    TZ_JY(3,"屠宰检疫"),
    WHH(4,"无害化"),
    YZ_DA(5,"养殖档案"),
    DC_GJ(6,"督查轨迹");

    private final Integer value;
    private final String description;

    AuthorityType(Integer value, String description){
        this.value = value;
        this.description = description;
    }

    public static AuthorityType from(Integer value) {
        for (AuthorityType authorityType : AuthorityType.values()) {
            if (authorityType.value.equals(value)) {
                return authorityType;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
